home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WWTCLKit / WWTTSVConnector.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  1.3 KB  |  83 lines

  1. /* SVConnector.m
  2.  * Written By:  Thomas Burkholder
  3.  *
  4.  * You may freely copy, distribute, and reuse the code in this example.
  5.  * NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  6.  * fitness for any particular use.
  7.  */
  8.  
  9. // name space protected for WavesWorld by the addition of the "WWTT" prefix
  10.  
  11. #import "WWTTSVConnector.h"
  12. #import "WWTTSwitchView.h"
  13.  
  14. @implementation WWTTSVConnector
  15.  
  16. - setSource:anObject
  17. {
  18.     source = anObject;
  19.     return self;
  20. }
  21.  
  22. - source
  23. {
  24.     return source;
  25. }
  26.  
  27. - setDestination:anObject
  28. {
  29.     destination = anObject;
  30.     return self;
  31. }
  32.  
  33. - destination
  34. {
  35.     return destination;
  36. }
  37.  
  38. - establishConnection
  39. {
  40.     return self;
  41. }
  42.  
  43. - nibInstantiate
  44. {
  45.     // by experimentation, we know IB calls the connectors in the reverse
  46.     // order that the connections were added to the document.
  47.  
  48.     [[source views] insertObject:destination at:0];
  49.     return self;
  50. }
  51.  
  52. - renewObject:old to:new
  53. {
  54.     if (old == source)
  55.         source = new;
  56.     else if (old == destination)
  57.         destination = new;
  58.     return self;
  59. }
  60.  
  61. - read:(NXTypedStream *)stream
  62. {
  63.     [super read:stream];
  64.     source = NXReadObject(stream);
  65.     destination = NXReadObject(stream);
  66.     return self;
  67. }
  68.  
  69. - write:(NXTypedStream *)stream
  70. {
  71.     [super write:stream];
  72.     NXWriteObject(stream, source);
  73.     NXWriteObject(stream, destination);
  74.     return self;
  75. }
  76.  
  77. - free
  78. {
  79.     return [super free];
  80. }
  81.  
  82. @end
  83.